<template>
  <div id=''>
    <h1>路由知识点子组件2</h1>
    <p>{{ $route.params.title }}</p>
    <p>{{ $route.params.content }}</p>
  </div>
</template>

<script lang='ts'>
export default {
  name: 'demoson1',
}
</script>

<script lang='ts' setup>
import { ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
//useRoute：路由上下文，能够获取路由参数，
//useRouter：路由对象，调用对象的方法
const route = useRoute();
const router = useRouter();

console.log(route.params)
</script>

<style lang='scss' scoped></style>
